<?php
/**
 * Created by PhpStorm.
 * User: zhangbing
 * Date: 2018/12/12
 * Time: 17:01
 */
namespace app\common\exception;

class NotFoundException extends BaseException {
    //默认状态码
    public $status = 404;
    //默认code码
    public $code   = 404;
    //默认返回信息
    public $msg    = 'The result was not found';

    public function __construct($param='') {
        if (empty($param)) {
            return;
        } elseif (is_numeric($param)) {
            $this->msg  = $this->codeMsg[$param];
            $this->code = $param;
        } elseif (is_string($param)) {
            $this->msg  = $param;
        }
    }

    private $codeMsg = [
        4001 => 'xxxx没找到',
    ];
}

